package edu.unc.comp410.colemangeer.model;

import org.apache.log4j.Logger;

import edu.unc.comp410.colemangeer.model.constraints.IConstraint;
import edu.unc.comp410.colemangeer.model.object.PersistentObject;

public class Order extends PersistentObject implements IConstraint {

	private final Customer customer;
	private final OrderItems items;
	private final ShippingInfo shipping;
	private final PaymentAuthorization paymentAuth;
	
	private final double salePrice;
	
	private static Logger log = Logger.getLogger(Order.class);
	
	/**
	 * Public constructors
	 */


	public Order(Integer id, Customer customer, OrderItems items,
			PaymentAuthorization paymentAuth, ShippingInfo shipping, double price) {
		super(id);
		this.customer = customer;
		this.items = items;
		this.paymentAuth = paymentAuth;
		this.shipping = shipping;
		this.salePrice = price;
		log.warn("New order constructed!");
		log.warn("Products in order:");

		for (LineItem item: items.getAllItems()){
			log.warn(item.toString());
		}
	}
	
	public Customer getCustomer() {
		return customer;
	}

	public OrderItems getItems() {
		return items;
	}

	public ShippingInfo getShipping() {
		return shipping;
	}

	public PaymentAuthorization getPaymentAuth() {
		return paymentAuth;
	}

	public double  getSalePrice() {
		return salePrice;
	}
	/**
	 * Inherited methods
	 */
	@Override
	public Object clone() throws CloneNotSupportedException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean equals(Object obj) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getConstraintName() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean isLegal(Object theObject) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void validate(Object theObject) throws IllegalStateException {
		// TODO Auto-generated method stub

	}

}
